]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspacesView: Clean up scroll code a bit
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 26 Nov 2012 04:54:11 +0000 (23:54 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 30 Nov 2012 21:03:34 +0000 (16:03 -0500)
There's no code path that results in us not animating.

https://bugzilla.gnome.org/show_bug.cgi?id=689062

js/ui/workspacesView.js

index 3528c9ad62ff88f8f4c745d518ea54e45f83f497..a247d2e61983ef5ba4d26aea10fc020a0b1a53e7 100644 (file)
@@ -208,11 +208,11 @@ const WorkspacesView = new Lang.Class({
             this._workspaces[w].positionWindows(Workspace.WindowPositionFlags.ANIMATE);
     },
 
-    _scrollToActive: function(showAnimation) {
+    _scrollToActive: function() {
         let active = global.screen.get_active_workspace_index();
 
-        this._updateWorkspaceActors(showAnimation);
-        this._updateScrollAdjustment(active, showAnimation);
+        this._updateWorkspaceActors(true);
+        this._updateScrollAdjustment(active);
     },
 
     // Update workspace actors parameters
@@ -270,26 +270,21 @@ const WorkspacesView = new Lang.Class({
         }
     },
 
-    _updateScrollAdjustment: function(index, showAnimation) {
+    _updateScrollAdjustment: function(index) {
         if (this._scrolling)
             return;
 
         this._animatingScroll = true;
 
-        if (showAnimation) {
-            Tweener.addTween(this.scrollAdjustment, {
-               value: index,
-               time: WORKSPACE_SWITCH_TIME,
-               transition: 'easeOutQuad',
-               onComplete: Lang.bind(this,
-                   function() {
-                       this._animatingScroll = false;
-                   })
-            });
-        } else {
-            this.scrollAdjustment.value = index;
-            this._animatingScroll = false;
-        }
+        Tweener.addTween(this.scrollAdjustment, {
+            value: index,
+            time: WORKSPACE_SWITCH_TIME,
+            transition: 'easeOutQuad',
+            onComplete: Lang.bind(this,
+                                  function() {
+                                      this._animatingScroll = false;
+                                  })
+        });
     },
 
     updateWorkspaces: function(oldNumWorkspaces, newNumWorkspaces) {
@@ -316,7 +311,7 @@ const WorkspacesView = new Lang.Class({
         if (this._scrolling)
             return;
 
-        this._scrollToActive(true);
+        this._scrollToActive();
     },
 
     _onDestroy: function() {